<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title>05-隐藏页面元素方式</title>
    <style>
        .box1 {
            background-color: tomato;
            width: 300px;
            height: 200px;
            /* display: none; */
            /* opacity: 0; */
            /* visibility: hidden; */
            position: absolute;
            left: -100000px;
        }

        .box2 {
            width: 300px;
            height: 200px;
            background-color: orange;
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <script>
        const box1 = document.querySelector('.box1')
        box1.onclick = function () {
            console.log(111111)
        }
    </script>
</body>

</html>